<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>商品数据</title>
  <style></style>
</head>
<body>
  <div action="" method="post">
    <table style="background-color: rgb(157, 255, 0);">
      <!-- <tr> 
        <td>商户名</td>
        <td>
          <input type="text" value="">
        </td>
      </tr>
      <tr>
        <td>商铺id</td>
        <td>
          <input type="text" value="">
        </td>
      </tr>
      <tr>
        <td>密码</td>
        <td>
          <input type="password" value="">
        </td>
      </tr>-->
      <tr>
        <td>商品名</td>
        <td>
          <input type="text" value="">
        </td>
      </tr>
      <tr>
        <td>价格</td>
        <td>
          <input type="text" value="">
        </td>
      </tr>
      <tr>
        <td>品牌</td>
        <td>
          <input type="text" value="">
        </td>
      </tr>
      <tr>
        <td>材质</td>
        <td>
          <input type="text" value="">
        </td>
      </tr>
      <tr>
        <td>图案</td>
        <td>
          <input type="jpg" value="">
        </td>
      </tr>
      <tr>
        <td>风格</td>
        <td>
          <input type="text" value="">
        </td>
      </tr>
      <tr>
        <td>颜色</td>
        <td>
          <input type="color" value="">
        </td>
      </tr>
      <tr>
        <td>上架时间</td>
        <td>
          <input type="date" value="">
        </td>
      </tr>
      <tr>
        <td>货物编号</td>
        <td>
          <input type="number" value="">
        </td>
      </tr>
      <tr>
        <td>适用季节</td>
        <td>
          <input type="text" value="">
        </td>
      </tr>
      <tr>
        <td>适用对象</td>
        <td>
          <input type="text" value="">
        </td>
      </tr>
      <tr>
        <td>适用性别</td>
        <td>
          <input type="radio" name="sex" value="0" checked>男
            <input type="radio" name="sex" value="1" >女
        </td>
      </tr>
      <tr>
        <td>产品图</td>
        <td>
          <input type="jpg" value="">
        </td>
      </tr>
      <tr>
        <td>发货地址</td>
        <td>
          <input type="text" value="">
        </td>
      </tr>
      <tr>
        <td colspan="2" style="text-align: center;">
          <button onclick="ajax()">提交</button>
        </td>
      </tr>
    </table>
  </div>
  <script>
    function ajax{
       //调用ajax
    var xhr = new XMLHttpRequest();
    //监听并接收数据
    xhr.onreadystatechange=function(){
      //判断
      if(readyState==4){
        if(xhr.status>=200&xhr.status<300){
          var result = xhr.responseText
          console.log(result)
        }
      }
    }
    //设置请求信息 方法 地址，同步异步
    xhr.open('post','/product',false)
    //设置请求头，先指定请求承诺书的解析凡是在传递数据'
    xhr.setRequestHeader('Cotent-type','application/x-www-form-urlencoded')
    //发送请求
    xhr.send();
    //接收响应的数据
    //var result= xhr.responseText
    //document.write(result);
    }
  </script>
</body>
</html>